package com.zx.feign.client.fallback;

import com.zx.core.wrapper.ObjectWrapper;
import com.zx.core.wrapper.ResponseWrapper;
import com.zx.feign.client.NotificationServiceClient;
import com.zx.feign.client.dto.GetNotificationTemplateResponseDTO;
import org.springframework.stereotype.Component;

/**
 * <p>
 * description: 通知服务Feign客户端降级处理 <br>
 * create: 2025-10-15
 * </p>
 *
 * @author zhou  xun
 */
@Component
public class FallbackNotificationServiceClient implements NotificationServiceClient {

    @Override
    public ResponseWrapper sendNotification(String paramJsonStr) {
        ResponseWrapper response = new ResponseWrapper();
        response.fail("通知服务暂时不可用");
        return response;
    }

    /**
     * 重新发送系统通知
     *
     * @param notificationId 通知ID
     * @return {@link ResponseWrapper}
     */
    @Override
    public ResponseWrapper resendNotification(String notificationId) {
        ResponseWrapper response = new ResponseWrapper();
        response.fail("通知服务暂时不可用");
        return response;
    }

    /**
     * 根据模板编码获取通知模板
     *
     * @param templateCode 模板编码
     * @return 通知模板信息
     */
    @Override
    public ObjectWrapper<GetNotificationTemplateResponseDTO> getTemplateByCode(String templateCode) {
        ObjectWrapper<GetNotificationTemplateResponseDTO> response = new ObjectWrapper();
        response.fail("通知服务暂时不可用");
        return response;
    }
}